/*
 * Copyright (c) 2012-2020 MIRACL UK Ltd.
 *
 * This file is part of MIRACL Core
 * (see https://github.com/miracl/core).
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/* Fixed Data in ROM - Field and Curve parameters */

package BLS12461

// Base Bits= 28
var Modulus = [...]Chunk{0xAAAAAAB, 0xAC0000A, 0x54AAAAA, 0x5555, 0x400020, 0x91557F0, 0xF26AA, 0xFA5C1CC, 0xB42A8DF, 0x7B14848, 0x8BACCA4, 0x6F1E32D, 0x4935FBD, 0x55D6941, 0xD5A555A, 0x5545554, 0x1555}
var ROI = [...]Chunk{0xAAAAAAA, 0xAC0000A, 0x54AAAAA, 0x5555, 0x400020, 0x91557F0, 0xF26AA, 0xFA5C1CC, 0xB42A8DF, 0x7B14848, 0x8BACCA4, 0x6F1E32D, 0x4935FBD, 0x55D6941, 0xD5A555A, 0x5545554, 0x1555}
var R2modp = [...]Chunk{0xC9B6A33, 0x2ECD087, 0x3CCB2B1, 0xCD461FE, 0x8CB5AB2, 0xC5B9635, 0x5312E92, 0xB659F64, 0x3B596FA, 0x8679006, 0xA92E2B3, 0x3CE05E3, 0x363550F, 0x7C07A8E, 0x382C083, 0x6347FEA, 0xBD}
var SQRTm3 = [...]Chunk{0xAAAAAAE, 0xA3FFFCA, 0x58AAAAA, 0x35555, 0x2200140, 0xAD53F60, 0x959AA1, 0xCF69415, 0x159B9FD, 0x4A29FE1, 0xC92EAD3, 0xCF1D928, 0x71360FC, 0x51D6941, 0xD5A555A, 0x5545554, 0x1555}

const MConst Chunk = 0xFFFFFFD

const CURVE_Cof_I int = 0
const CURVE_B_I int = 9

var CURVE_B = [...]Chunk{0x9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}
var CURVE_Order = [...]Chunk{0x1, 0x0, 0xFFFFC00, 0x7FEFFFE, 0x110000, 0x7FFC800, 0x801FC01, 0x5FD000E, 0x17FE0, 0xFFFC018, 0xFFFFFF7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}
var CURVE_Gx = [...]Chunk{0xADEE93D, 0x4D026A8, 0x74B7411, 0xD9C00EE, 0x31AC7F2, 0xC3981B5, 0x9218229, 0xD3564DC, 0xA096650, 0x6F7C292, 0x9743616, 0xBE922B1, 0x12CF668, 0xC81327, 0x463B73A, 0xE74E99B, 0xAD0}
var CURVE_Gy = [...]Chunk{0xAD1D465, 0xF763157, 0xC4FF470, 0x17884C8, 0xB8D215D, 0xA819E66, 0xF4959D0, 0xE5C3245, 0xB84910A, 0xB8BFA40, 0xBE96EEC, 0x8BF9F8C, 0xF277ACC, 0x5F1C3F2, 0x5F68C9, 0xCDB14B3, 0x77B}
var CURVE_HTPC = [...]Chunk{0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}

var Fra = [...]Chunk{0xB812A3A, 0x7117BF9, 0x99C400F, 0xC6308A5, 0x5BF8A1, 0x510E075, 0x45FA5A6, 0xCE4858D, 0x770B31A, 0xBC2CB04, 0xE2FC61E, 0xD073588, 0x4366190, 0x4DFEFA8, 0x69E55E2, 0x504B7F, 0x12E4}
var Frb = [...]Chunk{0xF298071, 0x3AE8410, 0xBAE6A9B, 0x39D4CAF, 0xFE4077E, 0x404777A, 0xBAF8104, 0x2C13C3E, 0x3D1F5C5, 0xBEE7D44, 0xA8B0685, 0x9EAADA4, 0x5CFE2C, 0x7D7999, 0x6BBFF78, 0x50409D5, 0x271}
var CURVE_Bnx = [...]Chunk{0x0, 0xFBFFFE0, 0x1FFFFF, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}
var CURVE_Cof = [...]Chunk{0x1, 0xFBFFFE0, 0x1FFFFF, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}

//var CURVE_Cof = [...]Chunk{0xAAAAAAB, 0xA7FFFEA, 0x1556AA, 0xD55AAAB, 0x554FFFF, 0x1555, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}
var CRu = [...]Chunk{0xFFFFFFE, 0x40001F, 0xFE00000, 0xFFE7FFF, 0xF0FFF6F, 0x7200C47, 0x7BCC604, 0x15796DB, 0xCF47771, 0x9875433, 0x613F0E8, 0x5000502, 0xEBFFF60, 0x1FFFFF, 0x0, 0x0, 0x0}
var CURVE_Pxa = [...]Chunk{0x6D0A37C, 0x5B50318, 0x75DCC46, 0xC2E492E, 0xD6878A9, 0xE01F919, 0xF92F564, 0x86DB74F, 0x66803F0, 0x46D581A, 0x7ED78D, 0x2F97C29, 0xC270C89, 0xF679453, 0x6A50A9A, 0x54138A0, 0x10CC}
var CURVE_Pxb = [...]Chunk{0x2C1C0AD, 0xF85CA8C, 0x25CADE9, 0x6CD66C4, 0xA289609, 0xC612951, 0xEE2401A, 0x529ABEB, 0xF65B17D, 0xBA09D33, 0xD4C5AF5, 0x4D4371E, 0x46A672E, 0xA279D22, 0xACEA37C, 0x1FB4FE5, 0x95C}
var CURVE_Pya = [...]Chunk{0x2FB006, 0xCCD0C1B, 0xA12A337, 0x3D194A4, 0xC92C895, 0x4960CFC, 0x39FC68B, 0x3A9B00F, 0xED1BA0F, 0xA7DBBC5, 0xA9CDFD8, 0x27CC2F7, 0x4E73ED2, 0x6070F4F, 0xEBA7E67, 0xAC848E7, 0x226}
var CURVE_Pyb = [...]Chunk{0xDF1457C, 0xA506ADF, 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